# -*- coding:utf-8 -*-
import thread,time
import logging

#定义日志
logger = logging.getLogger('dmfund') 
logger.setLevel(logging.DEBUG) 
# 创建一个handler，用于写入日志文件 
fh = logging.FileHandler('dmfund.log') 
#fh = logging.FileHandler('./zhuaqu.log') 
fh.setLevel(logging.DEBUG) 
# 定义handler的输出格式 
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') 
fh.setFormatter(formatter) 
#ch.setFormatter(formatter) 
# 给logger添加handler 
logger.addHandler(fh) 

#打印日志方法
def logprint(msg):
    print msg
    logger.info(msg)

def test():
    sql="REPLACE INTO tbl_dmfund_daily_quote (code,date,quote_hash,cvalue,zdzf_cyear,zdzf_week,zdzf_month,zdzf_3month,zdzf_6month,zdzf_year,tlpm_cyear,\
    tlpm_week,tlpm_month,tlpm_3month,tlpm_6month,tlpm_cyear) VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)"
    
    print sql
    
def test2():
    zdzf=['127.37', '-14.78', '11.64']
    #zdzf=['127.37', '-14.78', '11.64', '66.27']
    if len(zdzf)<6:
        for i in range(len(zdzf),6):
            print i
            zdzf.append('0.00')
    
    print zdzf
    
    tlpm=[('6', '363'), ('571', '618'), ('12', '528'), ('5', '406'), ('9', '359')]
    if len(tlpm)<6:
        for i in range(len(tlpm),6):
            print i
            tlpm.append(('0','0'))
    
    print tlpm
    
if __name__ == "__main__":
    test2()
    
    a=5
    print 5/2